import request from '@/utils/request';

// 查询退货单列表
export function listReturn(query) {
  return request({
    url: '/purchase/returns/list',
    method: 'get',
    params: query
  });
}

// 查询退货单详情
export function getReturn(returnNo) {
  return request({
    url: `/purchase/returns/view/${returnNo}`,
    method: 'get'
  });
}

// 新增退货单
export function addReturn(data) {
  return request({
    url: '/purchase/return',
    method: 'post',
    data: data
  });
}

// 修改退货单
export function updateReturn(data) {
  return request({
    url: '/purchase/return',
    method: 'put',
    data: data
  });
}
